<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>

<form:form commandName="model" cssClass="validate"
	action="app/message/receiver/save">
	<form:hidden path="id" />
	<form:hidden path="sourceId" />
	<table class=" form-table">
		<tbody>
			<tr>
				<td class="td1">接收人：</td>
				<td class="td2"><form:input path="receiverId" cssClass="hidden"
						value="${sender.name }" />
					<c:choose>
						<c:when test="${sender.userType eq 0 }">
				${sender.fullname }</c:when>
						<c:otherwise>

							<isperp:departmentUser displayValue="${sender.fullname }"
								valueControlId="receiverId" idFieldName="name"
								id="receiverIdSelect"></isperp:departmentUser>
						</c:otherwise>
					</c:choose>
				</td>
			</tr>

			<c:if test="${send.messageType ne 'LEAVEMSG' }">
				<tr>
					<td class="td1">标题：</td>
					<td class="td2"><input type="text" name="title"
						style="width:99%" value="${title }"></td>
				</tr>
			</c:if>
			<tr>
				<td class="td1">发送方式：</td>
				<td class="td2"><c:choose>
						<c:when test="${send.messageType eq 'LEAVEMSG' }">

							<input type="hidden" name="messageType" value="LEAVEMSG"
								id="sendTypeLEAVEMSG">
				回复客户留言</c:when>
						<c:otherwise>
							<input type="checkbox" name="messageType" value="MSG"
								checked="checked" readonly="readonly" id="sendTypeMSG">
							<label for="sendTypeMSG">内部消息</label>
							<input type="checkbox" name="messageType" value="EMAIL"
								id="sendTypeEMAIL">
							<label for="sendTypeEMAIL">邮件</label>
							<input type="checkbox" name="messageType" value="SMS"
								id="sendTypeSMS">
							<label for="sendTypeSMS">短信</label>
						</c:otherwise>
					</c:choose></td>
			</tr>
			<tr>
				<td class="td1">内容：</td>
				<td class="td2"><textarea name="content" class="editor"
						style="height: 300px">${content }</textarea></td>
			</tr>

		</tbody>
	</table>

</form:form>
<isperp:buttonList>
	<button class="submit"
		onclick="isperp.showLoading({onThisWindow:true}); isperp.submitForm({success : function() { isperp.closeDialog(); }});return false;">
		<span class="icon icon-save"></span>提交
	</button>
</isperp:buttonList>